import axios from 'axios'
import config from '@/service/config.js' // 倒入默认配置

const getGoodsInfo = user => {
  return axios.get(`${config.baseURL}/goods`)
    .then(res => {
      const {
        code,
        data: goodsInfo,
        slider,
        keys
      } = res.data;
      if (code) {
        return {
          goodsInfo,
          slider,
          keys
        }
      } else {
        return null
      }
    })
}

export default {
  getGoodsInfo
}
